package com.ddz.fightthelandlord;

import java.util.Random;

public class Deck {
	private Card[] mCards = new Card[52];

	public void makeDeck() {
		int cardIndex = 0;
		for (int iter1 = 3; iter1 < 16 && cardIndex < 52; iter1++) {
			for (int iter2 = 0; iter2 < 4 && cardIndex < 52; iter2++, cardIndex++) {
				mCards[cardIndex].setCardValue(iter1);
			}
		}
	}

	public void shuffleDeck() {
		int newIndex;
		Card temp;
		Random randIndex = new Random();

		for (int iter = 0; iter < 52; iter++) {

			newIndex = randIndex.nextInt(52);

			temp = mCards[iter];
			mCards[iter] = mCards[newIndex];
			mCards[newIndex] = temp;
		}
	}

	public Card[] getCards() {
		return mCards;
	}
}